/*
 * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

/*
 * @(#)DBMetaClient8.java	1.18 02/01/12
 */

package jdbcts.dbMeta.dbMeta8;

import java.io.*;
import java.util.*;

import java.sql.*;

import javax.sql.*;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import com.sun.cts.util.*;
import com.sun.cts.porting.*;
import com.sun.cts.harness.*;

import java.rmi.RemoteException;

import javasoft.sqe.javatest.Status;
import jdbcts.SuperTest;
import jdbcts.common.DataSourceConnection;
import jdbcts.common.DriverManagerConnection;
import jdbcts.common.dbSchema;

import com.sun.cts.tests.jdbc.ee.common.*;

// Merant DataSource class
//import com.merant.sequelink.jdbcx.datasource.*;

/**
 * The DBMetaClient8 class tests methods of DatabaseMetaData interface using
 * Sun's J2EE Reference Implementation.
 * 
 * @author
 * @version 1.7, 06/16/99
 */

public class DBMetaClient8 extends SuperTest implements Serializable
{
    private static final String testName = "jdbc.ee.dbMeta.dbMeta8";

    // Naming specific member variables
    private CTSNamingContextInterface jc = null;

    // Harness requirements

    private transient static Connection conn = null;

    private transient static DatabaseMetaData dbmd = null;

    private DataSource ds1 = null;

    private static dbSchema dbSch = null;

//    private String dbUser = null, drManager = null;
    private static String drManager = null;

//    private String sCatalogName = null, sSchemaName = null, sPtable = null,
//	    sFtable = null;

    /* Run test in standalone mode */
    // public static void main(String[] args)
    // {
    // DBMetaClient8 theTests = new DBMetaClient8();
    // Status s=theTests.run(args, System.out, System.err);
    // s.exit();
    // }
    /*
     * A private method to compare the Column Names & No of Columns Specific to
     * the test
     */
    private boolean columnCompare(String[] sColumnNames, ResultSet rs)
	    throws SQLException, Exception
    {

	ResultSetMetaData rsmd = null;
	boolean test_status = false;
	boolean statusColumnCount = true;
	boolean statusColumnMatch = true;

	int iColumnNamesLength = sColumnNames.length;
	rsmd = rs.getMetaData();
	int iCount = rsmd.getColumnCount();

	logMsg("Minimum Column Count is:" + iColumnNamesLength);

	// Comparing Column Lengths
	if (iColumnNamesLength <= iCount)
	{
	    iCount = iColumnNamesLength;
	    statusColumnCount = true;
	}
	else
	{
	    statusColumnCount = false;
	}

	logMsg("Comparing Column Names...");
	while (iColumnNamesLength > 0)
	{
	    if (sColumnNames[iColumnNamesLength - 1].equalsIgnoreCase(rsmd
		    .getColumnName(iCount)))
	    {
		statusColumnMatch = true;
	    }
	    else
	    {
		statusColumnMatch = false;
		break;
	    }
	    iCount--;
	    iColumnNamesLength--;
	}

	if ((statusColumnCount == true) && (statusColumnMatch == true))
	    test_status = true;

	return test_status;
    }

    /* Test setup: */
    /*
     * @class.setup_props: Driver, the Driver name; db1, the database name with
     * url; user1, the database user name; password1, the database password;
     * db2, the database name with url; user2, the database user name;
     * password2, the database password; DriverManager, flag for DriverManager;
     * ptable, the primary table; ftable, the foreign table; cofSize, the
     * initial size of the ptable; cofTypeSize, the initial size of the ftable;
     * binarySize, size of binary data type; varbinarySize, size of varbinary
     * data type; longvarbinarySize, size of longvarbinary data type;
     * 
     * @class.testArgs: -ap ctssql.stmt
     */
    @BeforeClass
//    public void setup(String[] args, Properties p) throws Exception
    public static void setup() throws Exception
    {
	try
	{
	    try
	    {
//		drManager = p.getProperty("DriverManager", "");
		drManager = isDRManager;
//		dbUser = p.getProperty("user1", "");
//		sPtable = p.getProperty("ptable", "CTSTABLE1");
//		sFtable = p.getProperty("ftable", "CTSTABLE2");
//		if (dbUser.length() == 0)
//		    throw new Exception("Invalid Login Id");
//		if (sPtable.length() == 0)
//		    throw new Exception("Invalid Primary table");
//		if (sFtable.length() == 0)
//		    throw new Exception("Invalid Foreign table");
		if (drManager.length() == 0)
		    throw new Exception("Invalid DriverManager Name");
//		sSchemaName = dbUser;
		if (drManager.equals("yes"))
		{
		    logMsg("Using DriverManager");
		    DriverManagerConnection dmCon = new DriverManagerConnection();
//		    conn = dmCon.getConnection(p);
		    conn = dmCon.getConnection(null);
		}
		else
		{
		    logMsg("Using DataSource");
		    DataSourceConnection dsCon = new DataSourceConnection();
//		    conn = dsCon.getConnection(p);
		    conn = dsCon.getConnection(null);
		}
		dbSch = new dbSchema();
//		dbSch.createData(p, conn);
		dbmd = conn.getMetaData();
	    }
	    catch (SQLException ex)
	    {
		logErr("SQL Exception : " + ex.getMessage());
	    }
	}
	catch (Exception e)
	{
	    logErr("Setup Failed!");
	    TestUtil.printStackTrace(e);
	}
    }

    /*
     * @testName: testDoesMaxRowSizeIncludeBlobs
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * doesMaxRowSizeIncludeBlobs() method must return a boolean value; true if
     * maximum row size includes LONGVARCHAR and LONGVARBINARY blobs and false
     * otherwise. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the doesMaxRowSizeIncludeBlobs() method. It should
     * return a boolean value
     */
    @Test
    public void testDoesMaxRowSizeIncludeBlobs() throws Exception
    {
	try
	{
	    logMsg("Calling  DatabaseMetaData.doesMaxRowSizeIncludeBlobs");
	    // invoke doesMaxRowSizeIncludeBlobs method
	    boolean retValue = dbmd.doesMaxRowSizeIncludeBlobs();
	    if (retValue)
		logMsg("MaxRowSize includes blobs");
	    else
		logMsg("MaxRowSize does not include blobs");
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception(
		    "Call to doesMaxRowSizeIncludeBlobs is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception(
		    "Call to doesMaxRowSizeIncludeBlobs is Failed!", e);
	}
    }

    /*
     * @testName: testGetMaxStatementLength
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getMaxStatementLength()
     * method must return an integer value; the value representing the maximum
     * number of characters allowed in SQL statement; 0 if there is no limit or
     * the limit is unknown. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getMaxStatementLength() method. It should return an
     * integer value
     */
    @Test
    public void testGetMaxStatementLength() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.getMaxStatementLength");
	    // invoke getMaxStatementLength method
	    int nRetval = dbmd.getMaxStatementLength();
	    if (nRetval < 0)
		logErr("getMaxStatementLength returns a negative value");
	    else
		logMsg("getMaxStatementLength returns " + nRetval);
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getMaxStatementLength is Failed!",
		    sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getMaxStatementLength is Failed!", e);
	}
    }

    /*
     * @testName: testGetMaxStatements
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getMaxStatements method
     * must return an integer value; the value representing the maximum number
     * of statements that can be open at one time to the database; 0 if there is
     * no limit or the limit is unknown. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getMaxStatements() method. It should return an
     * integer value
     */
    @Test
    public void testGetMaxStatements() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.getMaxStatements");
	    // invoke getMaxStatements method
	    int nRetval = dbmd.getMaxStatements();
	    if (nRetval < 0)
		logErr("getMaxStatements returns a negative value");
	    else
		logMsg("getMaxStatements returns " + nRetval);
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getMaxStatements is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getMaxStatements is Failed!", e);
	}
    }

    /*
     * @testName: testGetMaxTableNameLength
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getMaxTableNameLength()
     * method must return an integer value; the value representing the maximum
     * number of characters allowed in a table name; 0 if there is no limit or
     * the limit is unknown. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getMaxTableNameLength() method. It should return an
     * integer value
     */
    @Test
    public void testGetMaxTableNameLength() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.getMaxTableNameLength");
	    // invoke getMaxTableNameLength method
	    int nRetval = dbmd.getMaxTableNameLength();
	    if (nRetval < 0)
		logErr("getMaxTableNameLength returns a negative value");
	    else
		logMsg("getMaxTableNameLength returns " + nRetval);
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getMaxTableNameLength is Failed!",
		    sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getMaxTableNameLength is Failed!", e);
	}
    }

    /*
     * @testName: testGetMaxTablesInSelect
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getMaxTablesInSelect()
     * method must return an integer value; the value representing the maximum
     * number of tables in SELECT clause; 0 if there is no limit or the limit is
     * unknown. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getMaxTablesInSelect() method. It should return an
     * integer value
     */
    @Test
    public void testGetMaxTablesInSelect() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.getMaxTablesInSelect");
	    // invoke getMaxTablesInSelect method
	    int nRetval = dbmd.getMaxTablesInSelect();
	    if (nRetval < 0)
		logErr("getMaxTablesInSelect returns a negative value");
	    else
		logMsg("getMaxTablesInSelect returns " + nRetval);
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getMaxTablesInSelect is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getMaxTablesInSelect is Failed!", e);
	}
    }

    /*
     * @testName: testGetMaxUserNameLength
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getMaxUserNameLength()
     * method must return an integer value; the value representing the maximum
     * of characters allowed in a user name; 0 if there is no limit or the limit
     * is unknown. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getMaxUserNameLength() method. It should return an
     * integer value
     */
    @Test
    public void testGetMaxUserNameLength() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.getMaxUserNameLength");
	    // invoke getMaxUserNameLength method
	    int nRetval = dbmd.getMaxUserNameLength();
	    if (nRetval < 0)
		logErr("getMaxUserNameLength returns a negative value");
	    else
		logMsg("getMaxUserNameLength returns " + nRetval);
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getMaxUserNameLength is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getMaxUserNameLength is Failed!", e);
	}
    }

    /*
     * @testName: testGetDefaultTransactionIsolation
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * getDefaultTransactionIsolation() method must return an integer value; the
     * value representing the default Transaction Isolation. The value can be
     * any one of the following TRANSACTION_NONE, TRANSACTION_READ_UNCOMMITTED,
     * TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ and
     * TRANSACTION_SERIALIZABLE. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getDefaultTransactionIsolation() method. It should
     * return an integer value
     */
    @Test
    public void testGetDefaultTransactionIsolation() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.getDefaultTransactionIsolation");
	    // invoke getDefaultTransactionIsolation method
	    int nRetval = dbmd.getDefaultTransactionIsolation();
	    if ((nRetval != Connection.TRANSACTION_NONE)
		    && (nRetval != Connection.TRANSACTION_READ_UNCOMMITTED)
		    && (nRetval != Connection.TRANSACTION_READ_COMMITTED)
		    && (nRetval != Connection.TRANSACTION_REPEATABLE_READ)
		    && (nRetval != Connection.TRANSACTION_SERIALIZABLE))
	    {
		logErr("getDefaultTransactionIsolation returns an invalid value"
			+ nRetval);
		throw new Exception(
			"Call to getDefaultTransactionIsolation is Failed!");
	    }
	    else
		logMsg("getDefaultTransactionIsolation returns a valid Isolation level"
			+ nRetval);
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception(
		    "Call to getDefaultTransactionIsolation is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception(
		    "Call to getDefaultTransactionIsolation is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsTransactions
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsTransactions()
     * method must return a boolean value; true if transactions are supported
     * and false otherwise. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the supportsTransactions() method. It should return a
     * boolean value
     */
    @Test
    public void testSupportsTransactions() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.supportsTransactions");
	    // invoke supportsTransactions method
	    boolean retValue = dbmd.supportsTransactions();
	    if (retValue)
		logMsg("supportsTransactions is supported");
	    else
		logMsg("supportsTransactions is not supported");
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to supportsTransactions is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to supportsTransactions is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsBatchUpdates
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsBatchUpdates()
     * method must return a boolean value; true if the driver supports batch
     * updates and false otherwise. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the supportsBatchUpdates() method. It should return a
     * boolean value
     */
    @Test
    public void testSupportsBatchUpdates() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.supportsBatchUpdates");
	    // invoke supportsBatchUpdates method
	    boolean retValue = dbmd.supportsBatchUpdates();
	    if (retValue)
		logMsg("supportsBatchUpdates is supported");
	    else
		logMsg("supportsBatchUpdates is not supported");
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to supportsBatchUpdates is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to supportsBatchUpdates is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsDataDefinitionAndDataManipulationTransactions
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * supportsDataDefinitionAndDataManipulationTransactions method must return
     * a boolean value; true if both data definition and data manipulation
     * statements within a transaction are supported; false otherwise. (See JDK
     * 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the
     * supportsDataDefinitionAndDataManipulationTransactions() method. It should
     * return a boolean value
     */
    @Test
    public void testSupportsDataDefinitionAndDataManipulationTransactions()
	    throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.supportsDataDefinitionAndDataManipulationTransactions");
	    // invoke supportsDataDefinitionAndDataManipulationTransactions
	    // method
	    boolean retValue = dbmd
		    .supportsDataDefinitionAndDataManipulationTransactions();
	    if (retValue)
		logMsg("supportsDataDefinitionAndDataManipulationTransactions is supported");
	    else
		logMsg("supportsDataDefinitionAndDataManipulationTransactions is not supported");
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception(
		    "Call to supportsDataDefinitionAndDataManipulationTransactions is Failed!",
		    sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception(
		    "Call to supportsDataDefinitionAndDataManipulationTransactions is Failed!",
		    e);
	}
    }

    /*
     * @testName: testSupportsDataManipulationTransactionsOnly
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * supportsDataManipulationTransactionsOnly() method must return a boolean
     * value, true if the data manipulation statements within a transaction is
     * supported and false otherwise. A JDBC Compliant driver should return
     * true. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the supportsDataManipulationTransactionsOnly() method.
     * It should return a boolean value
     */
    @Test
    public void testSupportsDataManipulationTransactionsOnly() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.supportsDataManipulationTransactionsOnly");
	    // invoke supportsDataManipulationTransactionsOnly method
	    boolean retValue = dbmd.supportsDataManipulationTransactionsOnly();
	    if (retValue)
		logMsg("supportsDataManipulationTransactionsOnly is supported");
	    else
		logMsg("supportsDataManipulationTransactionsOnly is not supported");
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception(
		    "Call to supportsDataManipulationTransactionsOnly is Failed!",
		    sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception(
		    "Call to supportsDataManipulationTransactionsOnly is Failed!",
		    e);
	}
    }

    /*
     * @testName: testDataDefinitionCausesTransactionCommit
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * dataDefinitionCausesTransactionCommit() method must return a boolean
     * value; true if the data definition statement within a transaction is
     * forced the transaction to commit and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the dataDefinitionCausesTransactionCommit() method. It
     * should return a boolean value
     */
    @Test
    public void testDataDefinitionCausesTransactionCommit() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.dataDefinitionCausesTransactionCommit");
	    // invoke dataDefinitionCausesTransactionCommit method
	    boolean retValue = dbmd.dataDefinitionCausesTransactionCommit();
	    if (retValue)
		logMsg("Data definition statement forces the transaction to commit");
	    else
		logMsg("Data definition statement does not forces the transaction to commit");
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception(
		    "Call to dataDefinitionCausesTransactionCommit is Failed!",
		    sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception(
		    "Call to dataDefinitionCausesTransactionCommit is Failed!",
		    e);
	}
    }

    /*
     * @testName: testDataDefinitionIgnoredInTransactions
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * dataDefinitionIgnoredInTransactions() method must return a boolean value;
     * true if a data definition statement within a transaction is ignored and
     * false otherwise. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the dataDefinitionIgnoredInTransactions() method. It
     * should return a boolean value
     */
    @Test
    public void testDataDefinitionIgnoredInTransactions() throws Exception
    {
	try
	{
	    logMsg("Calling DatabaseMetaData.dataDefinitionIgnoredInTransactions");
	    // invoke dataDefinitionIgnoredInTransactions method
	    boolean retValue = dbmd.dataDefinitionIgnoredInTransactions();
	    if (retValue)
		logMsg("Data definition statement is ignored in a transaction");
	    else
		logMsg("Data definition statement is not ignored in a transaction");
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception(
		    "Call to dataDefinitionIgnoredInTransactions is Failed!",
		    sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception(
		    "Call to dataDefinitionIgnoredInTransactions is Failed!", e);
	}
    }

    /*
     * @testName: testGetProcedures
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getProcedures(String
     * catg, String schemapat, String procpat) method must return a ResultSet
     * object where catg is the catalog name, schemapat is schema pattern and
     * procpat is procedure name pattern. Each row of the ResultSet is the
     * description of the. stored procedure. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getProcedures() method. It should return a
     * ResultSet object Validate the column names and column ordering.
     */
    @Test
    public void testGetProcedures() throws Exception
    {
	try
	{
	    String sColumnNames[] = { "PROCEDURE_CAT", "PROCEDURE_SCHEM",
		    "PROCEDURE_NAME", "RESERVED1", "RESERVED2", "RESERVED3",
		    "REMARKS", "PROCEDURE_TYPE" };

	    ResultSetMetaData rsmd = null;

	    boolean statusColumnCount = true;
	    boolean statusColumnMatch = true;

	    int iColumnNamesLength = sColumnNames.length;

	    logMsg("Calling DatabaseMetaData.getProcedures");
	    // invoke getProcedures method
//	    ResultSet oRet_ResultSet = dbmd.getProcedures(sCatalogName,
//		    sSchemaName, "%");
	    ResultSet oRet_ResultSet = dbmd.getProcedures(null,
	    null, "%");	    
	    String sRetStr = new String();
	    // Store all the procedure names returned
	    sRetStr = "";

	    rsmd = oRet_ResultSet.getMetaData();
	    int iCount = rsmd.getColumnCount();

	    logMsg("Minimum Column Count is:" + iColumnNamesLength);

	    // Comparing Column Lengths
	    if (iColumnNamesLength <= iCount)
	    {
		iCount = iColumnNamesLength;
		statusColumnCount = true;
	    }
	    else
	    {
		statusColumnCount = false;
	    }

	    logMsg("Comparing Column Names...");

	    while (iColumnNamesLength > 0)
	    {

		if (iCount < 4 || iCount > 6)
		{
		    if (sColumnNames[iColumnNamesLength - 1]
			    .equalsIgnoreCase(rsmd.getColumnName(iCount)))
		    {
			statusColumnMatch = true;
		    }
		    else
		    {
			statusColumnMatch = false;
			break;
		    }
		}
		iCount--;
		iColumnNamesLength--;
	    }

	    if ((statusColumnCount == false) || (statusColumnMatch == false))
	    {
		logMsg("Columns return are not same either in order or name");
		throw new Exception("Call to getProcedures Failed!");
	    }

	    while (oRet_ResultSet.next())
		sRetStr += oRet_ResultSet.getString(3) + ",";
	    if (sRetStr == "")
		logMsg("getProcedures did not return any procedure names");
	    else
		logMsg("The Procedure names returned are : "
			+ sRetStr.substring(0, sRetStr.length() - 1));
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getProcedures is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getProcedures is Failed!", e);
	}
    }

    /*
     * @testName: testGetProcedureColumns
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getProcedureColumns(Str
     * ctlg,Str schp,String prp,String colpa) method must return a ResultSet
     * object with each row describes the information like parameter for the
     * stored procedure, return value of the stored procedure, etc., (See JDK
     * 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getProcedureColumns() method. It should return a
     * ResultSet object Validate the column names and column ordering.
     */
    @Test
    public void testGetProcedureColumns() throws Exception
    {
	try
	{
	    String sColumnNames[] = { "PROCEDURE_CAT", "PROCEDURE_SCHEM",
		    "PROCEDURE_NAME", "COLUMN_NAME", "COLUMN_TYPE",
		    "DATA_TYPE", "TYPE_NAME", "PRECISION", "LENGTH", "SCALE",
		    "RADIX", "NULLABLE", "REMARKS" };
	    boolean test_status = true;

	    logMsg("Calling DatabaseMetaData.getProcedureColumns");
	    // invoke getProcedureColumns method
//	    ResultSet oRet_ResultSet = dbmd.getProcedureColumns(sCatalogName,
//		    sSchemaName, "%", "%");
	    ResultSet oRet_ResultSet = dbmd.getProcedureColumns(null,
		    null, "%", "%");
	    String sRetStr = new String();
	    sRetStr = "";

	    // Call to columnCompare for the exact match of column names
	    test_status = columnCompare(sColumnNames, oRet_ResultSet);

	    if (test_status == false)
	    {
		logMsg("Columns return are not same either in order or name");
		throw new Exception("Call to getProcedureColumns Failed!");
	    }

	    // if necessary we can print the Procedurename.Columnname values
	    if (oRet_ResultSet.next())
		logMsg("getProcedureColumns returned some column names");
	    else
		logMsg("getProcedureColumns did not return any column names");
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getProcedureColumns is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getProcedureColumns is Failed!", e);
	}

    }

    /*
     * @testName: testGetTables
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getTables() method must
     * return a ResultSet object with each row is a description of the table
     * (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getTables() method. It should return a ResultSet
     * object Validate the column names and column ordering.
     */
    @Test
    public void testGetTables() throws Exception
    {
	try
	{
	    String sColumnNames[] = { "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME",
		    "TABLE_TYPE", "REMARKS" };
	    boolean test_status = true;

	    logMsg("Calling DatabaseMetaData.getTables");
	    // invoke getTables method
//	    ResultSet oRet_ResultSet = dbmd.getTables(sCatalogName,
//		    sSchemaName, "%", null);
	    ResultSet oRet_ResultSet = dbmd.getTables(null,
		    null, "%", null);
	    String sRetStr = new String();
	    sRetStr = "";

	    // Call to columnCompare for the exact match of column names
	    test_status = columnCompare(sColumnNames, oRet_ResultSet);

	    if (test_status == false)
	    {
		logMsg("Columns return are not same either in order or name");
		throw new Exception("Call to getTables Failed!");
	    }

	    // Store all the table names returned
	    while (oRet_ResultSet.next())
		sRetStr += oRet_ResultSet.getString(3) + ",";
	    if (sRetStr == "")
		logMsg("getTables did not return any table names");
	    else
		logMsg("The Table names returned are : "
			+ sRetStr.substring(0, sRetStr.length() - 1));
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getTables is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getTables is Failed!", e);
	}
    }

    /*
     * @testName: testGetSchemas
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getSchemas() method
     * must return a ResultSet object, with each row representing a schema name
     * available in the database (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getSchemas() method. It should return a ResultSet
     * object Validate the column names and column ordering.
     */
    @Test
    public void testGetSchemas() throws Exception
    {
	try
	{
	    String sColumnNames[] = { "TABLE_SCHEM" };
	    //String sColumnNames[] = { "TABLE_SCHEM" };
	    boolean test_status = true;

	    logMsg("Calling DatabaseMetaData.getSchemas");
	    // invoke getSchemas method
	    ResultSet oRet_ResultSet = dbmd.getSchemas();
	    String sRetStr = new String();
	    sRetStr = "";

	    // Call to columnCompare for the exact match of column names
	    test_status = columnCompare(sColumnNames, oRet_ResultSet);

	    if (test_status == false)
	    {
		logMsg("Columns return are not same either in order or name");
		throw new Exception("Call to getSchemas Failed!");
	    }

	    // Store all the Schema names returned
	    while (oRet_ResultSet.next())
		sRetStr += oRet_ResultSet.getString(1) + ",";
	    if (sRetStr == "")
		logMsg("getSchemas did not return any schema names");
	    else
		logMsg("The Schema names returned Are : "
			+ sRetStr.substring(0, sRetStr.length() - 1));
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getSchemas is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getSchemas is Failed!", e);
	}
    }

    /*
     * @testName: testGetCatalogs
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getCatalogs() method
     * must return a ResultSet object with each row representing a catalog name
     * available in the database. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getCatalogs() method. It should return a ResultSet
     * object Validate the column names and column ordering.
     */
    @Test
    public void testGetCatalogs() throws Exception
    {
	try
	{
	    String sColumnNames[] = { "TABLE_CAT" };
	    //String sColumnNames[] = { "TABLE_CAT" };
	    boolean test_status = true;

	    logMsg("Calling DatabaseMetaData.getCatalogs");
	    // invoke getCatalogs method
	    ResultSet oRet_ResultSet = dbmd.getCatalogs();
	    String sRetStr = new String();
	    sRetStr = "";

	    // Call to columnCompare for the exact match of column names
	    test_status = columnCompare(sColumnNames, oRet_ResultSet);
	    if (test_status == false)
	    {
		logMsg("Columns return are not same either in order or name");
		throw new Exception("Call to getCatalogs Failed!");
	    }

	    // Store all the Catalog names returned
	    while (oRet_ResultSet.next())
		sRetStr += oRet_ResultSet.getString(1) + ",";
	    if (sRetStr == "")
		logMsg("getCatalogs did not return any catalog names");
	    else
		logMsg("The Catalog names returned Are : "
			+ sRetStr.substring(0, sRetStr.length() - 1));
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getCatalogs is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getCatalogs is Failed!", e);
	}
    }

    /*
     * @testName: testGetTableTypes
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getTableTypes() method
     * must return a ResultSet object with each row representing a table type
     * available in the DBMS. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getTableTypes() method. It should return a
     * ResultSet object Validate the column names and column ordering.
     */
    @Test
    public void testGetTableTypes() throws Exception
    {
	try
	{
	    String sColumnNames[] = { "TABLE_TYPE" };
	    //String sColumnNames[] = { "TABLE_TYPE" };
	    boolean test_status = true;

	    logMsg("Calling DatabaseMetaData.getTableTypes");
	    // invoke getTableTypes method
	    ResultSet oRet_ResultSet = dbmd.getTableTypes();
	    String sRetStr = new String();
	    sRetStr = "";

	    // Call to columnCompare for the exact match of column names
	    test_status = columnCompare(sColumnNames, oRet_ResultSet);

	    if (test_status == false)
	    {
		logMsg("Columns return are not same either in order or name");
		throw new Exception("Call to getTableTypes Failed!");
	    }

	    // Store all the Table Types returned
	    while (oRet_ResultSet.next())
		sRetStr += oRet_ResultSet.getString(1) + ",";
	    if (sRetStr == "")
		logMsg("getTableTypes did not return any table types");
	    else
		logMsg("The Table Types returned Are : "
			+ sRetStr.substring(0, sRetStr.length() - 1));
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getTableTypes is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getTableTypes is Failed!", e);
	}
    }

    /*
     * @testName: testGetColumns
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The getColumns(String
     * clg,String schp,String tnpat,String colNamepat) method must return a
     * ResultSet object with each row is a description of a table column. (See
     * JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get a DatabaseMetadata object from the connection to the
     * database and call the getColumns() method. It should return a ResultSet
     * object Validate the column names and column ordering.
     */
    @Test
    public void testGetColumns() throws Exception
    {
	try
	{
	    String sColumnNames[] = { "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME",
		    "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME", "COLUMN_SIZE",
		    "BUFFER_LENGTH", "DECIMAL_DIGITS", "NUM_PREC_RADIX",
		    "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE",
		    "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
		    "ORDINAL_POSITION", "IS_NULLABLE" };
	    boolean test_status = true;

	    logMsg("Calling DatabaseMetaData.getColumns");
	    // invoke getColumns method
//	    ResultSet oRet_ResultSet = dbmd.getColumns(sCatalogName,
//		    sSchemaName, "%", "%");
	    ResultSet oRet_ResultSet = dbmd.getColumns(null,
		    null, "%", "%");

	    // Call to columnCompare for the exact match of column names
	    test_status = columnCompare(sColumnNames, oRet_ResultSet);
	    if (test_status == false)
	    {
		logMsg("Columns return are not same either in order or name");
		throw new Exception("Call to getColumns Failed!");
	    }

	    // if necessary we can print the Tablename.Columnname values
	    if (oRet_ResultSet.next())
		logMsg("getColumns returned some column names");
	    else
		logMsg("getColumns did not return any column names");
	}
	catch (SQLException sqle)
	{
	    logErr("SQL Exception " + sqle.getMessage());
	    throw new Exception("Call to getColumns is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected Exception " + e.getMessage());
	    throw new Exception("Call to getColumns is Failed!", e);
	}
    }

    /* cleanup */
    @AfterClass
    public static void cleanup() throws Exception
    {
	try
	{
	    // Close the database
	    // dbSch.destroyData(conn);
	    dbSch.dbUnConnect(conn);
	    logMsg("Cleanup ok;");
	}
	catch (Exception e)
	{
	    logErr("An error occurred while closing the database connection");
	}
    }
}
